package com.google.gwt.sample.dynatablerf.client.presenters;

import com.google.gwt.event.shared.EventBus;
import com.google.gwt.sample.dynatablerf.client.events.GoToStartViewEvent;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.TabLayoutPanel;

public class MainPresenter extends AbstractPresenter {

	public interface MainDisplay extends IsWidget {

		TabLayoutPanel getTabLayoutPanel();
	}

	private MainDisplay mainDisplay;

	public MainPresenter(MainDisplay mainDisplay, EventBus eventBus) {
		super(eventBus);
		this.mainDisplay = mainDisplay;
	}

	@Override
	protected void bind() {
		getEventBus().fireEvent(
				new GoToStartViewEvent(mainDisplay.getTabLayoutPanel()));

	}

	@Override
	protected IsWidget getDisplay() {
		return mainDisplay;
	}

}
